package parserdecoder

// type format string

// type Parser interface {
// 	Parse(io.Reader) error
// }

// type Decoder interface {
// 	Decode(io.Writer) error
// }

// type ParserBuilder func(common.Sorter, common.Filter) Parser

type register map[string]ParserBuilder

func (rter register) Get(k string) (ParserBuilder, bool) {
	v, ok := rter[k]
	return v, ok
}

var ParserBuilders register

func init() {
	ParserBuilders = make(register)
	ParserBuilders["txt"] = NewParserTXT
	ParserBuilders["m3u"] = NewParserM3U
}
